<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.hahehiho.myalbum.MyAlbumVO"%>
<%@page import="com.hahehiho.myalbum.MyAlbumDB"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,width=device-width" />
<title>MyAlbum</title>
<link rel="stylesheet" href="css/default.css" >

</head>
<%
String userAgent = request.getHeader("user-agent");
int tdsize = 1;
if(userAgent.matches(".*BlackBerry.*")) {
} else if(userAgent.matches(".*Android.*")) {
} else if(userAgent.matches(".*iPhone.*")) {
} else if(userAgent.matches(".*iPad.*")) {
	tdsize = 2;
} else {
	tdsize = 4;
}

String pkey = request.getParameter("pkey");

MyAlbumDB db = MyAlbumDB.getInstance();
MyAlbumVO vo = db.selectPhoto(pkey);

SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");	
String orgDate  = sdf.format(vo.getOrgDate().getTime());

%>
<body>
<table style="width:100%"><tr><td align="left" width="90%">
<h3><%=vo.getFilePath()%></h3>
</td>
</tr>
<tr><td align="right" width="80%">
<a href="editpic.jsp?pkey=<%=pkey%>" target="_new">edit</a>
</td>
</tr>
</table>
<hr>
<table style="width:95%">
<tr><td>
<label>Title : </label><%=vo.getXpTitle()%>
</td></tr>
<tr><td>
<label>Subject : </label><%=vo.getXpSubject()%>
</td></tr>
<tr><td>
<label>KeyWords : </label><%=vo.getXpKeywords()%>
</td></tr>
<tr><td>
<label>Comments : </label><%=vo.getXpComment()%>
</td></tr>
<tr><td>
<label>OrgDateTime : </label><%=orgDate%>
</td></tr>
<tr><td>
<label>GPS : </label><%=vo.getFullAddr()%>
</td></tr>
<tr><td>
<label>Latitude : </label><%=vo.getLatitude()%>
</td></tr>
<tr><td>
<label>Longitude : </label><%=vo.getLongitude()%>
</td></tr>
<tr>
<td align=center>
<%
%>
<img src=<%=vo.getUrlFile() %>>
</td></tr>
</table>
</body>
</html>